﻿using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.Effects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using Windows.UI;

namespace 纸片人.win2dEffectControl.DataClass
{
    public class ShadowEffectData : EffectOneSourceData
    {
        private float blurAmount =3f;
        private Color shadowColor = Colors.White;
        private Vector4 shadowColorHdr=new Vector4(0,0,0,1);
        private EffectOptimization optimization= EffectOptimization.Balanced;

    
        public Vector4 ShadowColorHdr { get => shadowColorHdr; set { shadowColorHdr = value; OnPropertyChanged(); SetIsChanges(); } }
        public Color ShadowColor { get => shadowColor; set { shadowColor = value; OnPropertyChanged(); SetIsChanges(); } }
        
        public float BlurAmount { get => blurAmount;  set { blurAmount = value; OnPropertyChanged(); SetIsChanges(); } }

        public EffectOptimization Optimization { get => optimization; set { optimization = value; OnPropertyChanged(); SetIsChanges(); } }
        #region 属性

        #endregion
        public override ICanvasImage GetEffect(CanvasDevice device, bool compression)
        {
            var source = GetSourceEffect(device, compression);
            if (source == null)
                return null;
           
            var effect = new ShadowEffect()
            {
                Source = source,
                BlurAmount = BlurAmount,
                Optimization = Optimization,
                ShadowColor = ShadowColor,
                ShadowColorHdr = ShadowColorHdr
            };
            return effect;
        }


    }
}